#include "Circle.h"

Circle::Circle() : Shape("black", false), mRadius(1) {
  /* empty */
}

Circle::Circle(double aRadius) : Shape("black", false) {
  this->mRadius = aRadius;
}

double Circle::getRadius() {
  return mRadius;
}

void Circle::setRadius(double aRadius) {
  this->mRadius = (aRadius >= 0) ? aRadius : 0;
}

double Circle::getArea() {
  return mRadius * mRadius * 3.14159;
}

double Circle::getPerimeter() {
  return 2 * mRadius * 3.14159;
}

double Circle::getDiameter() {
  return 2 * mRadius;
}

// this function redefines the toString function in the
// Shape class
string Circle::toString() {
	return "Circle color " + this->getColor() +
		" filled " + ((this->isFilled()) ? "true" : "false");
}
